\hypertarget{class_game_object}{
\section{GameObject Class Reference}
\label{class_game_object}\index{GameObject@{GameObject}}
}


Base class for graphical game objects.  


Inheritance diagram for GameObject:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.610723cm]{class_game_object}
\end{center}
\end{figure}
\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
struct \hyperlink{struct_game_object_1_1frame_data}{frameData}
\begin{DoxyCompactList}\small\item\em Structure for storing frame data for rewind mode playback. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{class_game_object_a9be545a57386f7d9a308e484026ada27}{GameObject} (\hyperlink{gameobject_8h_a57678b60d65afb213d04a6b090c64a08}{GameObjectType}, int, FPtype, \hyperlink{gameobject_8h_a390930e5106df06a541e66ea33eb85c9}{SpeedLimit}, bool, \hyperlink{gameobject_8h_a04d872bb0ec7701fa714b72007a6f562}{GameObjectMass} mass=MassNone, \hyperlink{gameobject_8h_a08995c712f6c983b592da8f4fc89ff59}{ScoreValue} scoreValue=ScoreNone)
\begin{DoxyCompactList}\small\item\em Constructor for \hyperlink{class_game_object}{GameObject}. \item\end{DoxyCompactList}\item 
\hypertarget{class_game_object_ab82dfdb656f9051c0587e6593b2dda97}{
\hyperlink{class_game_object_ab82dfdb656f9051c0587e6593b2dda97}{$\sim$GameObject} ()}
\label{class_game_object_ab82dfdb656f9051c0587e6593b2dda97}

\begin{DoxyCompactList}\small\item\em Destructs \hyperlink{class_game_object}{GameObject}. \item\end{DoxyCompactList}\item 
\hypertarget{class_game_object_a2cc33d151786496de58b0d78a5c9a57b}{
FPtype \hyperlink{class_game_object_a2cc33d151786496de58b0d78a5c9a57b}{posX} () const }
\label{class_game_object_a2cc33d151786496de58b0d78a5c9a57b}

\begin{DoxyCompactList}\small\item\em Returns the x-\/coordinate of a game object. \item\end{DoxyCompactList}\item 
\hypertarget{class_game_object_adcfb2c9df96ed072d2bc0e0e28e3b059}{
FPtype \hyperlink{class_game_object_adcfb2c9df96ed072d2bc0e0e28e3b059}{posY} () const }
\label{class_game_object_adcfb2c9df96ed072d2bc0e0e28e3b059}

\begin{DoxyCompactList}\small\item\em Returns the y-\/coordinate of a game object. \item\end{DoxyCompactList}\item 
\hypertarget{class_game_object_ad70e1bee018f2bd5571f4ede866ba013}{
FPtype \hyperlink{class_game_object_ad70e1bee018f2bd5571f4ede866ba013}{velX} () const }
\label{class_game_object_ad70e1bee018f2bd5571f4ede866ba013}

\begin{DoxyCompactList}\small\item\em Returns the x-\/axis velocity of a game object. \item\end{DoxyCompactList}\item 
\hypertarget{class_game_object_ad0d9dfed91e5be23929a5f62a3fae82e}{
FPtype \hyperlink{class_game_object_ad0d9dfed91e5be23929a5f62a3fae82e}{velY} () const }
\label{class_game_object_ad0d9dfed91e5be23929a5f62a3fae82e}

\begin{DoxyCompactList}\small\item\em Returns the y-\/axis velocity of a game object. \item\end{DoxyCompactList}\item 
\hypertarget{class_game_object_af40ccf02b70b5d577aa89ce4ffc82638}{
\hyperlink{gameobject_8h_a57678b60d65afb213d04a6b090c64a08}{GameObjectType} \hyperlink{class_game_object_af40ccf02b70b5d577aa89ce4ffc82638}{objectType} () const }
\label{class_game_object_af40ccf02b70b5d577aa89ce4ffc82638}

\begin{DoxyCompactList}\small\item\em Returns the game object type (one of {\ttfamily \hyperlink{gameobject_8h_a57678b60d65afb213d04a6b090c64a08}{GameObjectType}} values). \item\end{DoxyCompactList}\item 
\hypertarget{class_game_object_a0f77c417338310390dd86bd1b44100af}{
FPtype \hyperlink{class_game_object_a0f77c417338310390dd86bd1b44100af}{objectRadius} () const }
\label{class_game_object_a0f77c417338310390dd86bd1b44100af}

\begin{DoxyCompactList}\small\item\em Returns the radius of a game object. \item\end{DoxyCompactList}\item 
\hypertarget{class_game_object_ab1ab3e2eeda3ebfc608f82bc37389c05}{
\hyperlink{gameobject_8h_a04d872bb0ec7701fa714b72007a6f562}{GameObjectMass} \hyperlink{class_game_object_ab1ab3e2eeda3ebfc608f82bc37389c05}{mass} () const }
\label{class_game_object_ab1ab3e2eeda3ebfc608f82bc37389c05}

\begin{DoxyCompactList}\small\item\em Returns the mass of a game object (one of \hyperlink{gameobject_8h_a04d872bb0ec7701fa714b72007a6f562}{GameObjectMass} values). \item\end{DoxyCompactList}\item 
\hypertarget{class_game_object_aacdd5b48b4a16fc88ae497b2d1046a83}{
int \hyperlink{class_game_object_aacdd5b48b4a16fc88ae497b2d1046a83}{scoreValue} () const }
\label{class_game_object_aacdd5b48b4a16fc88ae497b2d1046a83}

\begin{DoxyCompactList}\small\item\em Returns the score value of a game object. \item\end{DoxyCompactList}\item 
\hypertarget{class_game_object_a8ffb4461c13ebaea0f506492e3bee03f}{
void \hyperlink{class_game_object_a8ffb4461c13ebaea0f506492e3bee03f}{setPosX} (FPtype posX)}
\label{class_game_object_a8ffb4461c13ebaea0f506492e3bee03f}

\begin{DoxyCompactList}\small\item\em Sets the x-\/coordinate of a game object. \item\end{DoxyCompactList}\item 
\hypertarget{class_game_object_a82b226a31acd875468192494633e0e3b}{
void \hyperlink{class_game_object_a82b226a31acd875468192494633e0e3b}{setPosY} (FPtype posY)}
\label{class_game_object_a82b226a31acd875468192494633e0e3b}

\begin{DoxyCompactList}\small\item\em Sets the y-\/coordinate of a game object. \item\end{DoxyCompactList}\item 
\hypertarget{class_game_object_adee1e7d8d4c605abe41a5cf82f19651a}{
void \hyperlink{class_game_object_adee1e7d8d4c605abe41a5cf82f19651a}{setVelX} (FPtype velX)}
\label{class_game_object_adee1e7d8d4c605abe41a5cf82f19651a}

\begin{DoxyCompactList}\small\item\em Sets the x-\/axis velocity of a game object. \item\end{DoxyCompactList}\item 
\hypertarget{class_game_object_a3765f59b290cc1fac0992bb28cde2e4a}{
void \hyperlink{class_game_object_a3765f59b290cc1fac0992bb28cde2e4a}{setVelY} (FPtype velY)}
\label{class_game_object_a3765f59b290cc1fac0992bb28cde2e4a}

\begin{DoxyCompactList}\small\item\em Sets the y-\/axis velocity of a game object. \item\end{DoxyCompactList}\item 
\hypertarget{class_game_object_a77fb03ca7aac5bcf95b67bf4b10853c2}{
void \hyperlink{class_game_object_a77fb03ca7aac5bcf95b67bf4b10853c2}{setMass} (\hyperlink{gameobject_8h_a04d872bb0ec7701fa714b72007a6f562}{GameObjectMass} mass)}
\label{class_game_object_a77fb03ca7aac5bcf95b67bf4b10853c2}

\begin{DoxyCompactList}\small\item\em Sets the mass of a game object (one of \hyperlink{gameobject_8h_a04d872bb0ec7701fa714b72007a6f562}{GameObjectMass} values). \item\end{DoxyCompactList}\item 
\hypertarget{class_game_object_aa19c54e8fc258e5630ac1cd61bc44704}{
void \hyperlink{class_game_object_aa19c54e8fc258e5630ac1cd61bc44704}{setScoreValue} (\hyperlink{gameobject_8h_a08995c712f6c983b592da8f4fc89ff59}{ScoreValue} scoreValue)}
\label{class_game_object_aa19c54e8fc258e5630ac1cd61bc44704}

\begin{DoxyCompactList}\small\item\em Sets the score value of a game object. \item\end{DoxyCompactList}\item 
bool \hyperlink{class_game_object_a38b5b6ee83e3a45c9a31ac9ddd071bd8}{isAlive} () const 
\item 
void \hyperlink{class_game_object_ae40eac74348cae8603481d0c4066601f}{setDead} (int frame, FPtype time)
\begin{DoxyCompactList}\small\item\em Sets game object to ''dead'' state. \item\end{DoxyCompactList}\item 
\hypertarget{class_game_object_a2f2f546bba050ee030b01a17a6007649}{
FPtype \hyperlink{class_game_object_a2f2f546bba050ee030b01a17a6007649}{diedTime} () const }
\label{class_game_object_a2f2f546bba050ee030b01a17a6007649}

\begin{DoxyCompactList}\small\item\em Returns the game the game object died. \item\end{DoxyCompactList}\item 
\hypertarget{class_game_object_ae5fbc22064c9c711c3d94ff7b1455744}{
int \hyperlink{class_game_object_ae5fbc22064c9c711c3d94ff7b1455744}{diedFrame} () const }
\label{class_game_object_ae5fbc22064c9c711c3d94ff7b1455744}

\begin{DoxyCompactList}\small\item\em Return the game frame the game object died. \item\end{DoxyCompactList}\item 
\hypertarget{class_game_object_a26ca085ec5c1a17d970ebf90f64e4cd5}{
void \hyperlink{class_game_object_a26ca085ec5c1a17d970ebf90f64e4cd5}{checkSpeed} ()}
\label{class_game_object_a26ca085ec5c1a17d970ebf90f64e4cd5}

\begin{DoxyCompactList}\small\item\em Check that the speed of the object does not go above \hyperlink{class_game_object}{GameObject} speed limit. \item\end{DoxyCompactList}\item 
\hypertarget{class_game_object_a77dcb9be29e8483239208c3832c684d2}{
void \hyperlink{class_game_object_a77dcb9be29e8483239208c3832c684d2}{scaleSpeed} (FPtype)}
\label{class_game_object_a77dcb9be29e8483239208c3832c684d2}

\begin{DoxyCompactList}\small\item\em Sets new speed to a \hyperlink{class_game_object}{GameObject}. \item\end{DoxyCompactList}\item 
\hypertarget{class_game_object_a1fac689e16be64e2d1de4d685a000b15}{
bool \hyperlink{class_game_object_a1fac689e16be64e2d1de4d685a000b15}{rewindEnabled} ()}
\label{class_game_object_a1fac689e16be64e2d1de4d685a000b15}

\begin{DoxyCompactList}\small\item\em Is rewind mode enabled. \item\end{DoxyCompactList}\item 
\hypertarget{class_game_object_aac92825159a142ab98257b730ef14b12}{
bool \hyperlink{class_game_object_aac92825159a142ab98257b730ef14b12}{isAliveAtFrame} (int) const }
\label{class_game_object_aac92825159a142ab98257b730ef14b12}

\begin{DoxyCompactList}\small\item\em Is \hyperlink{class_game_object}{GameObject} alive at {\itshape frame\/} given. \item\end{DoxyCompactList}\item 
\hypertarget{class_game_object_af6d70fca7e43ef62d40633342d7de907}{
void \hyperlink{class_game_object_af6d70fca7e43ef62d40633342d7de907}{writePosition} (int)}
\label{class_game_object_af6d70fca7e43ef62d40633342d7de907}

\begin{DoxyCompactList}\small\item\em Writes object position to the rewind buffer for a given {\itshape frame\/}. \item\end{DoxyCompactList}\item 
void \hyperlink{class_game_object_a3b4d73a49afdbbc42b4f488c93594aad}{initRewindMode} (int)
\begin{DoxyCompactList}\small\item\em Initializes rewind mode starting from {\itshape firstFrame\/}. \item\end{DoxyCompactList}\item 
\hypertarget{class_game_object_aa1f45e3bc0e7789689f0c1e4c96e881d}{
void \hyperlink{class_game_object_aa1f45e3bc0e7789689f0c1e4c96e881d}{readPosition} (int, GLfloat $\ast$)}
\label{class_game_object_aa1f45e3bc0e7789689f0c1e4c96e881d}

\begin{DoxyCompactList}\small\item\em Reads object position from a given {\itshape frame\/} to a {\itshape pos\/} from the rewind buffer. \item\end{DoxyCompactList}\item 
bool \hyperlink{class_game_object_a24f6e4f3c76e4fd511a70b0cfb1880aa}{isCollidable} (int currentFrame, \hyperlink{class_game_object}{GameObject} $\ast$other) const 
\begin{DoxyCompactList}\small\item\em Checks whether \hyperlink{class_game_object}{GameObject} is collidable with {\itshape other\/} \hyperlink{class_game_object}{GameObject}. \item\end{DoxyCompactList}\item 
\hypertarget{class_game_object_a3788b6450bdd3cafb5e823e226cc9ede}{
bool \hyperlink{class_game_object_a3788b6450bdd3cafb5e823e226cc9ede}{isCollidable} (int currentFrame) const }
\label{class_game_object_a3788b6450bdd3cafb5e823e226cc9ede}

\begin{DoxyCompactList}\small\item\em Check whether \hyperlink{class_game_object}{GameObject} is collidable on {\itshape currentFrame\/}. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static void \hyperlink{class_game_object_a15b9e1ac2b615faf9a2c2c5433665063}{setUnCollidable} (QList$<$ \hyperlink{class_game_object}{GameObject} $\ast$ $>$ \&)
\begin{DoxyCompactList}\small\item\em Sets group of given GameObjects uncollidable for each other for certain amount of frames. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_game_object_ae9bb4520e47a5d6733ac7061edf018e6}{
int \hyperlink{class_game_object_ae9bb4520e47a5d6733ac7061edf018e6}{storedDiedFrame}}
\label{class_game_object_ae9bb4520e47a5d6733ac7061edf018e6}

\begin{DoxyCompactList}\small\item\em Frame when \hyperlink{class_game_object}{GameObject} was died. Drawn to screen at last time. \item\end{DoxyCompactList}\item 
\hypertarget{class_game_object_a357f4fed9bab56800a30f085ee5b87f1}{
int \hyperlink{class_game_object_a357f4fed9bab56800a30f085ee5b87f1}{storedBornFrame}}
\label{class_game_object_a357f4fed9bab56800a30f085ee5b87f1}

\begin{DoxyCompactList}\small\item\em Frame when \hyperlink{class_game_object}{GameObject} was bord. Drawn to screen at firs time. \item\end{DoxyCompactList}\item 
\hypertarget{class_game_object_aedae4cc0a45863c386c97f24534a9ecf}{
FPtype \hyperlink{class_game_object_aedae4cc0a45863c386c97f24534a9ecf}{storedDiedTime}}
\label{class_game_object_aedae4cc0a45863c386c97f24534a9ecf}

\begin{DoxyCompactList}\small\item\em Time when \hyperlink{class_game_object}{GameObject} was died. Drawn to screen at last time. \item\end{DoxyCompactList}\item 
\hypertarget{class_game_object_a708f24258a67e9ce87ca6e3dcefcfe22}{
int \hyperlink{class_game_object_a708f24258a67e9ce87ca6e3dcefcfe22}{writeIndex}}
\label{class_game_object_a708f24258a67e9ce87ca6e3dcefcfe22}

\begin{DoxyCompactList}\small\item\em Current write index for frame data. \item\end{DoxyCompactList}\item 
\hypertarget{class_game_object_a1494f344da15ecc38ef375270d7b8859}{
bool \hyperlink{class_game_object_a1494f344da15ecc38ef375270d7b8859}{hasWrapped}}
\label{class_game_object_a1494f344da15ecc38ef375270d7b8859}

\begin{DoxyCompactList}\small\item\em Has game object wrapped. \item\end{DoxyCompactList}\item 
\hypertarget{class_game_object_a7a4dcfc0d3a9b3e9d6401b2eae08ca3b}{
int \hyperlink{class_game_object_a7a4dcfc0d3a9b3e9d6401b2eae08ca3b}{readIndex}}
\label{class_game_object_a7a4dcfc0d3a9b3e9d6401b2eae08ca3b}

\begin{DoxyCompactList}\small\item\em Current read index for frame data. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_game_object_a6f5c85c8b3a4cb373efb1faa229fc9f3}{
\hyperlink{gameobject_8h_a57678b60d65afb213d04a6b090c64a08}{GameObjectType} \hyperlink{class_game_object_a6f5c85c8b3a4cb373efb1faa229fc9f3}{type}}
\label{class_game_object_a6f5c85c8b3a4cb373efb1faa229fc9f3}

\begin{DoxyCompactList}\small\item\em Type of \hyperlink{class_game_object}{GameObject}. \item\end{DoxyCompactList}\item 
\hypertarget{class_game_object_aeaff64dabb04edd9540f93bf55d899bb}{
FPtype \hyperlink{class_game_object_aeaff64dabb04edd9540f93bf55d899bb}{radius}}
\label{class_game_object_aeaff64dabb04edd9540f93bf55d899bb}

\begin{DoxyCompactList}\small\item\em Radius. \item\end{DoxyCompactList}\item 
\hypertarget{class_game_object_a366da5e1cc46bb006c5eb67f6dacc6c6}{
FPtype \hyperlink{class_game_object_a366da5e1cc46bb006c5eb67f6dacc6c6}{speedLimit}}
\label{class_game_object_a366da5e1cc46bb006c5eb67f6dacc6c6}

\begin{DoxyCompactList}\small\item\em Maximum speed of game object. \item\end{DoxyCompactList}\item 
\hypertarget{class_game_object_ade20cdc96ec90b6e15e8357963f6cc06}{
FPtype \hyperlink{class_game_object_ade20cdc96ec90b6e15e8357963f6cc06}{positionX}}
\label{class_game_object_ade20cdc96ec90b6e15e8357963f6cc06}

\begin{DoxyCompactList}\small\item\em Current X position of game object on screen. \item\end{DoxyCompactList}\item 
\hypertarget{class_game_object_a2fda8a6001189b915a49421e3fe6e3f7}{
FPtype \hyperlink{class_game_object_a2fda8a6001189b915a49421e3fe6e3f7}{positionY}}
\label{class_game_object_a2fda8a6001189b915a49421e3fe6e3f7}

\begin{DoxyCompactList}\small\item\em Current Y position of game object on screen. \item\end{DoxyCompactList}\item 
\hypertarget{class_game_object_ab960306817d966d774a2ac76d2e85694}{
FPtype \hyperlink{class_game_object_ab960306817d966d774a2ac76d2e85694}{velocityX}}
\label{class_game_object_ab960306817d966d774a2ac76d2e85694}

\begin{DoxyCompactList}\small\item\em Current velocity of game object on X axle. \item\end{DoxyCompactList}\item 
\hypertarget{class_game_object_ab2f80f9cd68a847dc584a27f21d8850a}{
FPtype \hyperlink{class_game_object_ab2f80f9cd68a847dc584a27f21d8850a}{velocityY}}
\label{class_game_object_ab2f80f9cd68a847dc584a27f21d8850a}

\begin{DoxyCompactList}\small\item\em Current velocity of game object on Y axle. \item\end{DoxyCompactList}\item 
\hypertarget{class_game_object_a6e4697ddbaaa6c93a9922a067667f25d}{
\hyperlink{gameobject_8h_a04d872bb0ec7701fa714b72007a6f562}{GameObjectMass} \hyperlink{class_game_object_a6e4697ddbaaa6c93a9922a067667f25d}{objectMass}}
\label{class_game_object_a6e4697ddbaaa6c93a9922a067667f25d}

\begin{DoxyCompactList}\small\item\em Mass of game object. \item\end{DoxyCompactList}\item 
\hypertarget{class_game_object_a2cb33538b34b332c21a1504201826931}{
\hyperlink{gameobject_8h_a08995c712f6c983b592da8f4fc89ff59}{ScoreValue} \hyperlink{class_game_object_a2cb33538b34b332c21a1504201826931}{score}}
\label{class_game_object_a2cb33538b34b332c21a1504201826931}

\begin{DoxyCompactList}\small\item\em Score value. \item\end{DoxyCompactList}\item 
\hypertarget{class_game_object_a6c38fabf41438e6007be997d5b3e8eab}{
int \hyperlink{class_game_object_a6c38fabf41438e6007be997d5b3e8eab}{collisionGroup}}
\label{class_game_object_a6c38fabf41438e6007be997d5b3e8eab}

\begin{DoxyCompactList}\small\item\em Collision group ID for game object. \item\end{DoxyCompactList}\item 
\hypertarget{class_game_object_a3ee86ac46329f02da0cc320505826995}{
QVector$<$ \hyperlink{struct_game_object_1_1frame_data}{frameData} $>$ $\ast$ \hyperlink{class_game_object_a3ee86ac46329f02da0cc320505826995}{buffer}}
\label{class_game_object_a3ee86ac46329f02da0cc320505826995}

\begin{DoxyCompactList}\small\item\em Frame data for rewind mode. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Static Private Attributes}
\begin{DoxyCompactItemize}
\item 
static const int \hyperlink{class_game_object_a3effe25d7be75935ce5170e33c00ab4f}{collisionFreeFrames} = 5
\begin{DoxyCompactList}\small\item\em Number of collision free frames. \item\end{DoxyCompactList}\item 
\hypertarget{class_game_object_a5df0a5db41bfaee6e0c5da188c98a386}{
static int \hyperlink{class_game_object_a5df0a5db41bfaee6e0c5da188c98a386}{collisionGroupCounter} = 0}
\label{class_game_object_a5df0a5db41bfaee6e0c5da188c98a386}

\begin{DoxyCompactList}\small\item\em Number of collision groups. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Friends}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_game_object_a90715c6106457b6d9eb6161c5828542b}{
class \hyperlink{class_game_object_a90715c6106457b6d9eb6161c5828542b}{MeteorShower}}
\label{class_game_object_a90715c6106457b6d9eb6161c5828542b}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
Base class for graphical game objects. When extending from \hyperlink{class_game_object}{GameObject} usually some enumerations and constants are needed to create, e.g. see the {\ttfamily \hyperlink{class_missile}{Missile}} constructor implementation: 
\begin{DoxyCode}
 Missile::Missile(int bornFrame, bool rewindEnabled, FPtype guidanceFactor, FPtyp
      e speedFactor)
     : GameObject(TypeMissile, bornFrame, GameEngine::GameObjectRadiusMissile, 
      SpeedLimitExtraHigh,
                  rewindEnabled, MassTiny, ScoreMissile) { ... }
\end{DoxyCode}



\begin{DoxyItemize}
\item Create a new entry in the {\ttfamily \hyperlink{gameobject_8h_a57678b60d65afb213d04a6b090c64a08}{GameObjectType}} enumeration.
\item Define a constant radius value for game object as in {\ttfamily \hyperlink{class_game_engine_a5148cf44e0c55e9acc4c3b0e5de3e58f}{GameEngine::GameObjectRadiusMissile}} 
\item Select one of the speed limit values {\ttfamily \hyperlink{gameobject_8h_a390930e5106df06a541e66ea33eb85c9}{SpeedLimit}} for enemy object
\item Select one of the mass values in {\ttfamily \hyperlink{gameobject_8h_a04d872bb0ec7701fa714b72007a6f562}{GameObjectMass}} 
\item Create a new entry in the {\ttfamily \hyperlink{gameobject_8h_a08995c712f6c983b592da8f4fc89ff59}{ScoreValue}} 
\end{DoxyItemize}

\subsection{Constructor \& Destructor Documentation}
\hypertarget{class_game_object_a9be545a57386f7d9a308e484026ada27}{
\index{GameObject@{GameObject}!GameObject@{GameObject}}
\index{GameObject@{GameObject}!GameObject@{GameObject}}
\subsubsection[{GameObject}]{\setlength{\rightskip}{0pt plus 5cm}GameObject::GameObject (
\begin{DoxyParamCaption}
\item[{{\bf GameObjectType}}]{ gameObjectType, }
\item[{int}]{ bornFrame, }
\item[{FPtype}]{ gameObjectRadius, }
\item[{{\bf SpeedLimit}}]{ gameObjectSpeedLimit, }
\item[{bool}]{ rewindEnabled, }
\item[{{\bf GameObjectMass}}]{ mass = {\ttfamily MassNone}, }
\item[{{\bf ScoreValue}}]{ scoreValue = {\ttfamily ScoreNone}}
\end{DoxyParamCaption}
)}}
\label{class_game_object_a9be545a57386f7d9a308e484026ada27}


Constructor for \hyperlink{class_game_object}{GameObject}. 

{\itshape gameObjectType\/} Type of the game object as \hyperlink{gameobject_8h_a57678b60d65afb213d04a6b090c64a08}{GameObjectType}

{\itshape bornFrame\/} Current frame number. When the \hyperlink{class_game_object}{GameObject} was created.

{\itshape gameObjectRadius\/} Radius of the game object as FPtype.

{\itshape gameObjectSpeedLimit\/} Maximum speed of the game object as \hyperlink{gameobject_8h_a390930e5106df06a541e66ea33eb85c9}{SpeedLimit}.

{\itshape rewindEnabled\/} Is the rewind mode enabled.

{\itshape mass\/} Mass of the game object as \hyperlink{gameobject_8h_a04d872bb0ec7701fa714b72007a6f562}{GameObjectMass}.

{\itshape scoreValue\/} Score value of the game object as \hyperlink{gameobject_8h_a08995c712f6c983b592da8f4fc89ff59}{ScoreValue}. 

\subsection{Member Function Documentation}
\hypertarget{class_game_object_a3b4d73a49afdbbc42b4f488c93594aad}{
\index{GameObject@{GameObject}!initRewindMode@{initRewindMode}}
\index{initRewindMode@{initRewindMode}!GameObject@{GameObject}}
\subsubsection[{initRewindMode}]{\setlength{\rightskip}{0pt plus 5cm}void GameObject::initRewindMode (
\begin{DoxyParamCaption}
\item[{int}]{ firstFrame}
\end{DoxyParamCaption}
)}}
\label{class_game_object_a3b4d73a49afdbbc42b4f488c93594aad}


Initializes rewind mode starting from {\itshape firstFrame\/}. 

Determines into readIndex a best possible guess for a location where relevant data reading might start from, when the rewind mode is started from the given frame.

If {\ttfamily firstFrame} is older than {\ttfamily bornFrame} of the game object the {\ttfamily readIndex} is set to {\ttfamily bornFrame}.


\begin{DoxyParams}{Parameters}
\item[{\em firstFrame}]The rewind mode playback start frame. \end{DoxyParams}
\hypertarget{class_game_object_a38b5b6ee83e3a45c9a31ac9ddd071bd8}{
\index{GameObject@{GameObject}!isAlive@{isAlive}}
\index{isAlive@{isAlive}!GameObject@{GameObject}}
\subsubsection[{isAlive}]{\setlength{\rightskip}{0pt plus 5cm}bool GameObject::isAlive (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{class_game_object_a38b5b6ee83e3a45c9a31ac9ddd071bd8}
Returns true if game object is in ''alive'' state. When game object is ''alive'' it's rendered in normal game play state \hypertarget{class_game_object_a24f6e4f3c76e4fd511a70b0cfb1880aa}{
\index{GameObject@{GameObject}!isCollidable@{isCollidable}}
\index{isCollidable@{isCollidable}!GameObject@{GameObject}}
\subsubsection[{isCollidable}]{\setlength{\rightskip}{0pt plus 5cm}bool GameObject::isCollidable (
\begin{DoxyParamCaption}
\item[{int}]{ currentFrame, }
\item[{{\bf GameObject} $\ast$}]{ other}
\end{DoxyParamCaption}
) const}}
\label{class_game_object_a24f6e4f3c76e4fd511a70b0cfb1880aa}


Checks whether \hyperlink{class_game_object}{GameObject} is collidable with {\itshape other\/} \hyperlink{class_game_object}{GameObject}. 

Objects are not collidable if they are in the same collision group and are still in collision free frames. \hypertarget{class_game_object_ae40eac74348cae8603481d0c4066601f}{
\index{GameObject@{GameObject}!setDead@{setDead}}
\index{setDead@{setDead}!GameObject@{GameObject}}
\subsubsection[{setDead}]{\setlength{\rightskip}{0pt plus 5cm}void GameObject::setDead (
\begin{DoxyParamCaption}
\item[{int}]{ frame, }
\item[{FPtype}]{ time}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{class_game_object_ae40eac74348cae8603481d0c4066601f}


Sets game object to ''dead'' state. 

When game object is in ''dead'' state it's not rendered in normal game play state but it may be rendered in rewind mode playback.


\begin{DoxyParams}{Parameters}
\item[{\em frame}]Current game frame, the frame the game object died \item[{\em time}]Current game time, the time the game object died \end{DoxyParams}
\hypertarget{class_game_object_a15b9e1ac2b615faf9a2c2c5433665063}{
\index{GameObject@{GameObject}!setUnCollidable@{setUnCollidable}}
\index{setUnCollidable@{setUnCollidable}!GameObject@{GameObject}}
\subsubsection[{setUnCollidable}]{\setlength{\rightskip}{0pt plus 5cm}void GameObject::setUnCollidable (
\begin{DoxyParamCaption}
\item[{QList$<$ {\bf GameObject} $\ast$ $>$ \&}]{ objects}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}static\mbox{]}}}}
\label{class_game_object_a15b9e1ac2b615faf9a2c2c5433665063}


Sets group of given GameObjects uncollidable for each other for certain amount of frames. 

Objects are set uncollidable for amount of {\ttfamily collisionFreeFrames}. Used for example when large ateroid is smahed for three smaller. 

\subsection{Member Data Documentation}
\hypertarget{class_game_object_a3effe25d7be75935ce5170e33c00ab4f}{
\index{GameObject@{GameObject}!collisionFreeFrames@{collisionFreeFrames}}
\index{collisionFreeFrames@{collisionFreeFrames}!GameObject@{GameObject}}
\subsubsection[{collisionFreeFrames}]{\setlength{\rightskip}{0pt plus 5cm}const int {\bf GameObject::collisionFreeFrames} = 5\hspace{0.3cm}{\ttfamily  \mbox{[}static, private\mbox{]}}}}
\label{class_game_object_a3effe25d7be75935ce5170e33c00ab4f}


Number of collision free frames. 

Assume that average framerate is around 50 fps -\/$>$ time for a single frame is 1000 ms / 50 = 20 ms. Setting 5 collision free frames would make 0.1 seconds and it should be enough. NOTE! Bigger values are bad because normal collision logic WILL eventually be interfered. 

The documentation for this class was generated from the following files:\begin{DoxyCompactItemize}
\item 
\hyperlink{gameobject_8h}{gameobject.h}\item 
gameobject.cpp\end{DoxyCompactItemize}
